package com.bnz.portal.service.impl;

import com.bnz.portal.dao.ContentDao;
import com.bnz.portal.entity.ContentEntity;
import com.bnz.portal.service.ContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author xy
 * @date 2022/11/9
 */
@Service
public class ContentServiceImpl implements ContentService {

    @Autowired
    ContentDao contentDao;


    @Override
    public List<ContentEntity> list() {
        List<ContentEntity> list = contentDao.findAll();
        return list;
    }


    @Cacheable("findByCategoryId2")
    @Override
    public List<ContentEntity> findByCategoryId2(String i) {
        List<ContentEntity> list = contentDao.findByCategoryId(i);
        return list;
    }
}
